import React from 'react'
import Son from './Son'
//映入样式表时要加.css 通过className使用类样式
//注意;用脚手架打出来的项目.默认样式没有模块化的故cssObj为空,需要自己配置,配置后cssObj为对象,样式的模块化只正对类选择器和id选择器
//配置为:options: {
//     importLoaders: 1,
//     modules: true
//   }
import cssObj from '../css/list.css'
// console.log(cssObj)
export default class Parent extends React.Component {
    constructor() {
        super();
        this.state = {
            list:[
                {id:1,name:'zz'},
                {id:2,name:'ll'},
                {id:3,name:'ww'}
            ]
        }
    }
    render () {
        return  <div>
                <h2 style={  {fontSize:'30px',fontWeight: 200,textAlign:'center'}  } className={cssObj.title}>评论组件</h2>
                {this.state.list.map(item=><Son {...item} key={item.id}></Son>)}
            </div>
    }
}